package API.Collection.Set.Traversal;

import java.util.HashSet;
import java.util.Set;
import java.util.function.Consumer;

public class InnerClassAndLambda {
    public static void main(String[] args) {
        Set<Integer> set = new HashSet<>();
        for(int i = 1; i <= 10; i++){
            set.add(i);
        }
        set.forEach(new Consumer<Integer>() {
            @Override
            public void accept(Integer integer) {
                System.out.print(integer + " ");
            }
        });
        System.out.println();
        set.forEach(integer -> {
            System.out.print(integer + " ");
        });
    }
}
